package com.ys.web.sys.redisMessage.model;

import com.ys.base.BaseDao;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface RedisMessageMapper extends BaseDao {

    @Insert("insert ignore into sys_redis_message (id,channel,message) values (#{id},#{channel}, #{message})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int create(SysRedisMessage sysRedisMessage);

    @Update("update sys_redis_message set handler_result=#{handler} where id=#{id}")
    int handle(@Param("handler") int handler, @Param("id") Long id);

    @Update("update sys_redis_message set handler_result=3,remark=#{errMsg} where id=#{id} and handler_result!=2")
    int handleErr(@Param("id") Long id, @Param("errMsg") String errMsg);
}
